
import org.apache.commons.beanutils.PropertyUtils;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;

@Service
public class SysVersionManageServiceImpl implements SysVersionManageService  {

    @Resource
    private SysVersionManageMapper sysVersionManageMapper;

    /**
     * 获取 SysVersionManage 分页列表
     */
    @Transactional
    public IPage getSysVersionManagePagination( PaginationVo paginationVo, SysVersionManageQuery sysVersionManageQuery ) throws Exception {

        IPage page = new Page( paginationVo.getPageIndex(), paginationVo.getPageSize() );
        LambdaQueryWrapper<SysVersionManageEntity> lqs = new LambdaQueryWrapper();
        sysVersionManageMapper.selectPage(page, lqs);

        List<SysVersionManageEntity> record = page.getRecords();
        if( !ObjectUtil.isNotEmptyList(record)){
            return page;
        }
        return null;
    }


    /**
     * 获取 SysVersionManage 所有数据
     *
    */
    @Transactional
    public List<SysVersionManageEntity> getSysVersionManageAllList( SysVersionManageQuery sysVersionManageQuery ) throws Exception {

        LambdaQueryWrapper<SysVersionManageEntity> lqs = new LambdaQueryWrapper();
        List<SysVersionManageEntity> list = sysVersionManageMapper.selectList(lqs);
        return list;
    }


    /**
     * 获取 SysVersionManage 详情
    */
    @Transactional
    public SysVersionManageEntity getSysVersionManageDetail( Long id) throws Exception {

        SysVersionManageEntity sysVersionManage = sysVersionManageMapper.selectById(id);
        return sysVersionManage;
    }


    /**
     * 新增 SysVersionManage
     * */
    @Transactional
    public void addSysVersionManage(SysVersionManageVo sysVersionManageVo) throws Exception {

        SysVersionManageEntity sysVersionManage = new SysVersionManageEntity();
        ReflectionCopy.copyProperties( sysVersionManage, sysVersionManageVo );
        sysVersionManageMapper.insert(sysVersionManage);
        return;
    }


    /**
     * 更新 SysVersionManage
     * */
    @Transactional
    public void updateSysVersionManage( SysVersionManageVo sysVersionManageVo) throws Exception {

        if( sysVersionManageVo.getId() == null ){
            throw GlobalException.gen(10021, "id不存在");
        }
        SysVersionManageEntity sysVersionManage = new SysVersionManageEntity();
        ReflectionCopy.copyProperties( sysVersionManage, sysVersionManageVo );
        sysVersionManageMapper.updateById(sysVersionManage);
        return;
    }

    /**
     * 删除 SysVersionManage
     * */
    @Transactional
    public void batchRemoveSysVersionManage( List<Long> ids ) throws Exception {


        if( !ObjectUtil.isNotEmptyList(ids) ){
            throw GlobalException.gen(10011, "要删除的id不存在");
        }
        sysVersionManageMapper.deleteBatchIds(ids);
    }

}

      